<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'contact.label', default: 'Contact')}"/>
    <title>修改客户信息</title>
    <style>
    i.fa.fa-chevron-down::before{
        display: none;
    }
    i.fa.fa-chevron-up::before{
        display: none;
    }
    </style>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>PLS CINDATA</li>
                    <li>
                        <g:link controller="menu" action="index">CINDATA</g:link>
                    </li>
                    <li class="active">
                        <span>修改客户信息</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                修改客户信息
            </h2>
        </div>
    </div>
</div>


<g:if test="${flash.message}">
    <div class="message alert alert-info" role="status">${flash.message}</div>
</g:if>
<g:hasErrors bean="${this.menu}">
    <ul class="errors" role="alert">
        <g:eachError bean="${this.menu}" var="error">
            <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                    error="${error}"/></li>
        </g:eachError>
    </ul>
</g:hasErrors>


<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hblue">
            <div class="panel-heading">
                修改客户信息
            </div>

            <div class="panel-body form-horizontal">

                <div class="panel-heading">
                    5.贷款调查意见
                </div>
                <div class="form-group">
                    <div class="col-md-4 col-md-offset-1">
                        <label class="control-label">借款人借款行为真实，材料齐备、真实、有效。建议同意贷款，贷款条件如下表所列：</label>
                    </div>
                </div>
                <g:form action="customerSurveyReport">
                    <input type="hidden" name="reportId" value="${this.contactSurveyReport?.id}" id="reportId">
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">金额</label>
                        <div class="col-md-3">
                            <div class="input-group m-b">
                                <g:textField class="form-control" type="text" name="loansAmount"  value="${this.contactSurveyReport?.loansAmount}" placeholder="请输入数字" />
                                <span class="input-group-addon">元</span>
                            </div>
                        </div>
                        <label class="col-md-2 control-label is-required">期数</label>
                        <div class="col-md-3">
                            <div class="input-group m-b">
                                <g:textField class="form-control" type="text" name="loansDuration" id="loansDuration" value="${this.contactSurveyReport?.loansDuration}" placeholder="请输入数字"/>
                                <span class="input-group-addon">月</span>
                            </div>
                        </div>
                    </div>


                    <div class="form-group ">
                        <label class="col-md-2 control-label is-required">利率</label>
                        <div class="col-md-4">
                            <div class="radio radio-info radio-inline">
                                <g:radio name="mortgageRatio" value="公积金贷款基准利率" checked="${contactSurveyReport?.mortgageRatio == '公积金贷款基准利率'}"/>
                                <label for="sex1">公积金贷款基准利率</label>
                            </div>
                            <div class="radio radio-info radio-inline ">
                                <g:radio name="mortgageRatio" value="公积金贷款基准利率上浮10" checked="${contactSurveyReport?.mortgageRatio == '公积金贷款基准利率上浮10'}"/>
                                <label for="sex2">公积金贷款基准利率上浮10%</label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group ">

                        <label class="col-md-2 control-label is-required">还款方式</label>
                        <div class="col-md-3">
                            <g:each in="${com.cindata.dictionary.RepaymentModeDict.list()}">
                                <div class="radio radio-info radio-inline ">
                                    <g:radio name="starRepaymentMode" value="${it?.id}" checked="${contactSurveyReport?.starRepaymentMode?.id == it?.id}"/>
                                    <label>${it?.name}</label>
                                </div>
                            </g:each>
                        </div>
                    </div>

                    <div class="form-group ">
                        <label class="col-md-2 control-label is-required">放款方式</label>
                        <div class="col-md-4">
                            <g:each in="${com.cindata.dictionary.LoanMethodDict.list()}">
                                <div class="radio radio-info radio-inline ">
                                    <g:radio name="loanMethod" value="${it?.id}" checked="${contactSurveyReport?.loanMethod?.id == it?.id}"/>
                                    <label>${it?.name}</label>
                                </div>
                            </g:each>
                        </div>
                        <label class="col-md-2 control-label is-required">贷款资金最终收款人</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="finalPayeeOfLoans" id="finalPayeeOfLoans" value="${contactSurveyReport?.finalPayeeOfLoans}"/>
                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-md-3">
                            <div class="checkbox checkbox-info checkbox-inline">
                                <input type="checkbox" class="i-checks everyCheckbox">
                                <label class="is-required"><strong>否决贷款申请。原因说明：</strong></label>
                                <div class="col-md-8">
                                    <g:textField name="mortgageRejectReason" id="mortgageRejectReason" value="${contactSurveyReport?.mortgageRejectReason}" class="form-control" style="width: 500px"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-6">
                            <g:submitButton class="btn btn-info" name="create3" value="下一步"/>
                            <button type="button" class="btn cancelButton" style="margin-left: 20px;">取消</button>
                        </div>
                    </div>
                </g:form>
            </div>
        </div>
    </div>


</div>
<g:javascript>
    $(function () {
        var checkboxs =$('.everyCheckbox');
        document.getElementById('mortgageRejectReason').setAttribute('disabled','true');
        checkboxs.on('ifChecked ifUnchecked',function(event){
            console.log("event.type:  "+event.type)
            if(event.type == 'ifChecked'){
                document.getElementById('mortgageRejectReason').removeAttribute('disabled');
            }else{
                document.getElementById('mortgageRejectReason').setAttribute('disabled','true');
            }
        });

    });
</g:javascript>
</body>
</html>
